﻿/*
///    This file is part of BannerLib4Net.
///
///    BannerLib4Net is free software: you can redistribute it and/or modify
///    it under the terms of the GNU General Public License as published by
///    the Free Software Foundation, either version 3 of the License, or
///    (at your option) any later version.

///    BannerLib4Net is distributed in the hope that it will be useful,
///    but WITHOUT ANY WARRANTY; without even the implied warranty of
///    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
///    GNU General Public License for more details.
///
///    You should have received a copy of the GNU General Public License
///    along with BannerLib4Net.  If not, see <http://www.gnu.org/licenses/>.
*/


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace BannerLib4Net.Data.Configuration
{
    public class ConnectionSettings
    {
        public String Server { get; set; }
        public int? Port { get; set; }
        public String Password { get; set; }
        public String User { get; set; }
        public String Database { get; set; }
        public bool Debug { get; set; }
        public int? Timeout { get; set; }


        public ConnectionSettings()
        {
        }

        public ConnectionSettings(String server, String database, String user, String password, int? port)
        {
            this.Server = server;
            this.Port = port;
            this.Database = database;
            this.Password = password;
            this.User = user;
        }

        public String ToConnectionString()
        {
            return String.Format("Server={0};Port={1};User Id={2};Password={3};Database={4};",
                                 this.Server, this.Port, this.User, this.Password, this.Database);
        }

        public override string ToString()
        {
            return string.Format("[ConnectionSettings: Server={0}, Port={1}, Password={2}, User={3}, Database={4}, Debug={5}]", Server, Port, Password, User, Database, Debug);
        }

    }
}
